package com.titanrise.crm.mapper;

import com.titanrise.crm.domain.model.Salesperson;
import com.titanrise.crm.environment.annotation.*;

import java.util.List;

@Mapper
public interface salespersonMapper {

    @Select("select * from tb_salesperson")
    @ResultType(Salesperson.class)
    List<Salesperson> selectAll();

    @Select("select * from tb_salesperson where user_id = #{userID}")
    @ResultType(Salesperson.class)
    Salesperson selectByUserID(@Param("userID") String userID);

    @Update("UPDATE tb_salesperson SET phone_number = #{phoneNumber} WHERE user_id = #{userId}")
    int updatePhoneNumberByUid(@Param("userId") String userId, @Param("phoneNumber") String phoneNumber);
}
